<!DOCTYPE html>
<html>
    <head>
	<meta charset="utf-8">
    <title> __PUBLIC__</title>

    <meta name="description" content="Dashboard">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!--Basic Styles-->
    <link href="__PUBLIC__/style/bootstrap.css" rel="stylesheet">
    <link href="__PUBLIC__/style/font-awesome.css" rel="stylesheet">
    <link href="__PUBLIC__/style/weather-icons.css" rel="stylesheet">

    <!--Beyond styles-->
    <link id="beyond-link" href="__PUBLIC__/style/beyond.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/style/demo.css" rel="stylesheet">
    <link href="__PUBLIC__/style/typicons.css" rel="stylesheet">
    <link href="__PUBLIC__/style/animate.css" rel="stylesheet">
    <style type="text/css">
        .goodintro{float: left;line-height: 40px;color: #999;width: 80px;height:40px;text-align: center;}
        .btnclas{background: #2DC3E8;color:#fff;}
        .absolutediv{display: none;}
        .tabletdstyle{text-align:center;height:100px;font-size:0.8em;}
    </style>

    </head>
<body>
	<!-- 头部 -->
	{include file='common/header'}
	<!-- /头部 -->
	
	<div class="main-container container-fluid">
		<div class="page-container">
			<!-- Page Sidebar -->
            {include file='common/left'}
            <!-- /Page Sidebar -->
            <!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <a href="javascript:void(0)">系统</a>
                        </li>
                        <li class="active">
                            <a href="{:url('article/lists')}">文章管理</a>
                        </li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->
                <!-- Page Body -->
                <div class="page-body">
                <button type="button" tooltip="添加文章" class="btn btn-sm btn-azure btn-addon" onClick="testfunc(this)" value=''> 
                <!-- <button type="button" tooltip="添加文章" class="btn btn-sm btn-azure btn-addon" onClick="javascript:window.location.href = '{:url('article/add')}'" value='1'>  -->
                    <i class="fa fa-plus"></i> 
                    Add
                </button>
                <div class="row">
                    <div class="col-lg-12 col-sm-12 col-xs-12" style='overflow:auto;'>
                        <div class="widget">
                            <div class="widget-body" style='overflow:auto;'>
                                <div class='divbody' style='overflow:auto;'>
                                    <div>
                                        <div style='position:relative;overflow:auto;'>
                                            {volist name="result" id="vo"}
                                                {if condition="$key=='超值套餐'"}
                                                    <div class='goodintro'>超值套餐</div>
                                                {/if}
                                                {if condition="$key=='超值机票'"}
                                                    <div class='goodintro'>超值机票</div>
                                                {/if}
                                            {/volist}
                                        </div>
                                    </div>
                                    <div style="overflow:auto;width:100%;">
                                        <div style='position:relative;' class='introgooddiv'>
                                            {volist name="result" id="vo"}
                                                {if condition="$key=='超值套餐'"}
                                                    <div style='position:absolute;width:100%;top:0px;left:0px;z-Index:99900;float:left;overflow:auto;' class='absolutediv'>
                                                        <div style='overflow:auto;'>
                                                            <div class="flip-scroll">
                                                                <table class="table table-bordered table-hover">
                                                                    <thead class="">
                                                                        <tr>
                                                                            <th class="text-center" width="8%">产品名称</th>
                                                                            <th class="text-center" width="8%">价格</th>
                                                                            <th class="text-center" width="10%">评价</th>
                                                                            <th class="text-center" width="12%">图片</th>
                                                                            <th class="text-center" width="5%">点赞</th>
                                                                            <th class="text-center" width="10%">操作</th>
                                                                        </tr>
                                                                    </thead>
                                                                    <tbody>
                                                                        {volist name='vo' id='voc'}
                                                                        <tr style='text-align:center;height:100px;line-height:100px;'>
                                                                            <input type='hidden' name='title' value='{$voc.title}'>
                                                                            <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.name}</td>
                                                                            <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.price}</td>
                                                                            <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.specials}</td>
                                                                            <td><img style='height:100px;' src="__UPLOADS__{$voc.singleinfo.picurl}"></td>
                                                                            <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.click}</td>
                                                                            <td style='text-align:center;height:100px;line-height:100px;'>
                                                                                <a href="{:url('Websites/editgood',array('_id'=>$voc.id,'type'=>'2'))}" class="btn btn-primary btn-sm shiny">
                                                            <i class="fa fa-edit"></i> 编辑
                                                        </a>
                                                        <a href="{:url('Websites/delete',array('_id'=>$voc.id))}" class="btn btn-primary btn-sm shiny">
                                                            <i class="fa fa-edit"></i> 删除
                                                        </a>
                                                                            </td>
                                                                        </tr> 
                                                                        {/volist} 
                                                                    </tbody>
                                                                </table>
                                                              
                                                            </div>
                                                        </div>
                                                    </div>
                                                {/if}
                                                {if condition="$key=='超值机票'"}
                                                <div style='position:absolute;width:100%;top:0px;left:0px;z-Index:99900;float:left;overflow:auto;display:block;' class='absolutediv'>
                                                    <div style='overflow:auto;'>
                                                        <div class="flip-scroll">
                                                            <table class="table table-bordered table-hover">
                                                                <thead class="">
                                                                    <tr>
                                                                        <th class="text-center" width="12%">航空公司</th>
                                                                        <th class="text-center" width="8%">始发地</th>
                                                                        <th class="text-center" width="8%">目的地</th>
                                                                        <th class="text-center" width="8%">价格</th>
                                                                        <th class="text-center" width="8%">起飞时间</th>
                                                                        <th class="text-center" width="5%">点赞</th>
                                                                        <th class="text-center" width="18%">评价</th>
                                                                        <th class="text-center" width="10%">操作</th>
                                                                    </tr>
                                                                </thead>
                                                                <tbody>
                                                                   
                                                                    
                                                                        {volist name='vo' id='voc'}
                                                                        
                                                                            <tr style='text-align:center;'>
                                                                                <input type='hidden' name='title' value='{$voc.title}'>
                                                                                <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.airname}</td>
                                                                                <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.startplace}</td>
                                                                                <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.endplace}</td>
                                                                                <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.price}</td>
                                                                                <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.flytime}</td>
                                                                                <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.click}</td>
                                                                                <td class='tabletdstyle' style='line-height:100px;'>{$voc.singleinfo.specials}</td>
                                                                                <td class='tabletdstyle' style='line-height:100px;' style='text-align:center;height:100px;line-height:100px;'>
                                                                                    <a href="{:url('Websites/edit',array('Id'=>$voc.id,'type'=>'2'))}" class="btn btn-primary btn-sm shiny">
                                                                <i class="fa fa-edit"></i> 编辑
                                                            </a>
                                                            <a href="{:url('Websites/delete',array('_id'=>$voc.id))}" class="btn btn-primary btn-sm shiny">
                                                                <i class="fa fa-edit"></i> 删除
                                                            </a>
                                                                                </td>
                                                                            </tr> 
                                                                        {/volist}
                                                                </tbody>
                                                            </table>
                                                          
                                                        </div>
                                                    </div>
                                                </div>
                                                {/if}
                                            {/volist}    
                                        </div>
                                    </div>
                                </div>  
                            </div>
                            </div>
                        </div>
                    </div>
                </div>
                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
		</div>	
	</div>

	    <!--Basic Scripts-->
    <script src="__PUBLIC__/style/jquery_002.js"></script>
    <script src="__PUBLIC__/style/bootstrap.js"></script>
    <script src="__PUBLIC__/style/jquery.js"></script>
    <!--Beyond Scripts-->
    <script src="__PUBLIC__/style/beyond.js"></script>
    
    <script type="text/javascript">
        $(function(){
            $('button[type=button]').val($('.goodintro:eq(0)').html());
            $('.introgooddiv').css({'height':$('.absolutediv:eq(0)').height()});
            $('.goodintro:eq(0)').addClass('btnclas');
            $('.goodintro').on('click',function(){
                var indexbtn=$(this).index();
                $(this).addClass('btnclas').siblings().removeClass('btnclas');
                $('.absolutediv:eq('+indexbtn+')').css({'display':'block'}).siblings().css({'display':'none'});
                $('.introgooddiv').css({'height':$('.absolutediv:eq('+indexbtn+')').height()});
                // alert()
                $('button[type=button]').val($(this).html());
            })
        })


        function testfunc(e){
            var titlelen=$('input[value='+e.value+']').length;
            if(titlelen>4||titlelen==4){
                alert('改套餐数目已经是4条，无法继续添加!');
                return;
            }

            // type存在为1，则表示添加;
            // type存在为2，则表示编辑;
            switch(e.value){
                // 添加超值机票
                case '超值机票':
                    // alert('nihao')
                    // window.location.href="www.baidu.com";
                    window.location.href='{:url("Websites/edit",array("type"=>"1"))}';
                    break;

                // 添加超值套餐
                case '超值套餐':
                    window.location.href="{:url('Websites/editgood',array('type'=>'1'))}";
                    break;
            }
        }
    </script>

</body></html>